package java_DesignPattern.StructuralPattern.CompositePattern;

public class MenuItem extends MenuCompoment {

    /**
     * 构建菜单项
     * @param name
     * @param level
     */
    public MenuItem(String name, int level) {
        super(name, level);
    }

    @Override
    public void print() {
        for (int i = 0; i < level; i++) {
            System.out.print("-");
        }
        System.out.println(getName());
    }

    @Override
    public void remove(MenuCompoment menuCompoment) {
        super.remove(menuCompoment);
    }

    @Override
    public String getName() {
        return super.getName();
    }
}
